<?
session_start();
include("classes/connect.php");
require_once('classes/class.jira.php');
include('config.php');
ini_set('display_errors', 'Off');

$selecteddata=$_POST['deletedata'];

$config->username= $username;
$config->password= $pass;
$config->port= "";
$config->host= $host;
$queryIssue = new Jira($config);

if(isset($_POST['appid']))
{
//    var_dump($_POST['appid']);
//    
//    echo sizeof($_POST['val']);
//    exit;

	unset($_SESSION['curstatus']);
	$_SESSION['curstatus']=$_POST['curstatus'];
	
	unset($_SESSION['pageno']);
	$_SESSION['pageno']=$_POST['pageno'];
	
	unset($_SESSION['assignee']);
	$_SESSION['assignee']=$_POST['assignee'];
	
	unset($_SESSION['post']);
	$_SESSION['post']=$_POST['post'];
	
	unset($_SESSION['priority']);
	$_SESSION['priority']=$_POST['priority'];
	
	unset($_SESSION['fromDate']);
	$_SESSION['fromDate']=$_POST['fromDate'];
	
	unset($_SESSION['toDate']);
	$_SESSION['toDate']=$_POST['toDate'];
	
    $appid[]=$_POST['appid'];
    $appjiraid[]=$_POST['appjiraid'];
    
    for($i=0;$i<$_POST['val'];$i++){
    $jiraid=$_POST['appjiraid'][$i];
    $sql="UPDATE trn_emaildetails SET
			deleted='1'
			WHERE id='".$_POST['appid'][$i]."'";
    mysql_query($sql);
	$query=$jiraid;
	$array=$queryIssue->deleteIssue($query);
    }
    
    echo $_POST['appid'];
}

?>
